package io.choerodon.platform.app.service.impl;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;

import io.choerodon.platform.app.service.UserService;
import io.choerodon.platform.infra.mapper.UserOpenAccountC7nMapper;

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserOpenAccountC7nMapper userOpenAccountC7nMapper;


    @Override
    public List<String> queryOpenAppUserIds(Long organizationId, List<Long> userIds, String openAppCode) {
        if (ObjectUtils.isEmpty(userIds)) {
            return new ArrayList<>();
        }
        return userOpenAccountC7nMapper.listOpenUserIdsByC7nUserIds(new HashSet<>(userIds), organizationId, openAppCode);
    }
}
